@extends('backend.layouts.main-iframe')
@section('iframe-css')
<link rel="stylesheet" href="{{URL::asset('backend/AdminLTE/plugins/select2/select2.min.css')}}">
<!-- Select2 -->
<script src="{{URL::asset('backend/AdminLTE/plugins/select2/select2.full.min.js')}}"></script>
@endsection
@section('content')
<div class="col-md-12">
    <div class="box box-primary">
        <form method="POST" action="{{URL('admin/permissions')}}">
            {{ csrf_field() }}
            <div class="box-body">
                <label>父级</label><br/>
                <select class="form-control select2" style="width: 100%;" name="menusId">
                    <option value='0'>顶级</option>
                    @foreach($menusDatas['menusData'] AS $key=>$per)
                    <option value='{{$menusDatas['ids'][$key]['id']}}'>{{$per['permissions_name']}}</option>
                    @endforeach
                </select>
                <div class="form-group">
                    <label for="inputWarning">菜单名称</label>
                    <input type="text" class="form-control" name="permissions_name" placeholder="请输入权限名称" value="{{ old('permissions_name')}}">
                    @if ($errors->has('permissions_name'))
                    <span class="help-block">
                        <strong style="color: #a94442;">{{ $errors->first('permissions_name') }}</strong>
                    </span>
                    @endif
                </div>
                <div class="form-group">
                    <label for="inputWarning">路由</label>
                    <input type="text" class="form-control" name="urls" placeholder="请输入权限说明" value="{{ old('urls')}}">
                    @if ($errors->has('urls'))
                    <span class="help-block">
                        <strong style="color: #a94442;">{{ $errors->first('urls') }}</strong>
                    </span>
                    @endif
                </div>
                <div class="form-group">
                    <label for="inputWarning">图标</label>
                    <input type="text" class="form-control" name="icons" placeholder="" value="">
                </div>
            </div>
            <div class="box-footer">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </form>
    </div>
</div>
@endsection
@section('iframe-script')
<script>
$(".select2").select2();
</script>
@endsection
